﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sharp.Domain.PlatformBoundedContext.PersonModule.Aggregates;
using Sharp.Domain.Repositories;
using Sharp.Infrastructure;

namespace Sharp.Domain.PlatformBoundedContext.PersonModule.Services
{
    public partial class PersonService : IPersonService
    {
        private IRepositoryContext _repositoryContext;
        private IEmployeeRepository  _employeeRepository;
        private IJobRepository _jobRepository;

        public PersonService(IRepositoryContext repositoryContext, IEmployeeRepository employeeRepository,
            IJobRepository jobRepository)
        {
            _repositoryContext = repositoryContext;
            _employeeRepository = employeeRepository;
            _jobRepository = jobRepository;
        }



        public Result DeleteEmployee(Guid[] ids)
        {
            _employeeRepository.Remove(ids);

            _repositoryContext.Commit();
            return new Result();
        }

        public Result DeleteJob(Guid[] ids)
        {
            _jobRepository.Remove(ids);

            _repositoryContext.Commit();
            return new Result();
        }
    }
}